package com.boot.common.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * 实体类的基类
 * 包含了实体类的公共属性，如创建时间、更新时间、逻辑删除标识等
 */
@Getter
@Setter
@Accessors(chain = true)
public class BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id(keyType = KeyType.Auto)
    public Long id;

    /**
     * 创建人
     */
    @Column(value = "create_by")
    public Long createBy;

    /**
     * 创建时间
     */
    @Column(value = "create_time")
    public Long createTime;

    /**
     * 更新人
     */
    @Column(value = "update_by")
    public Long updateBy;

    /**
     * 更新时间
     */
    @Column(value = "update_time")
    public Long updateTime;

    /**
     * 逻辑删除
     * 0-正常 1-删除
     */
    @Column(value = "is_deleted", isLogicDelete = true)
    public Integer isDeleted;

}
